import React, { useEffect } from 'react';
import { history } from 'umi';
import * as echarts from 'echarts';
import './index.css';

// 价值评估统计
export default function index() {
  const init = () => {
    var myChart = echarts.init(document.getElementById('main'));
    myChart.setOption({
      tooltip: {
        trigger: 'item',
      },
      legend: {
        orient: 'vertical',
        left: 'left',
      },
      series: [
        {
          name: '客户数量',
          type: 'pie',
          radius: ['40%', '70%'],
          data: [
            { value: 57, name: '很高' },
            { value: 29, name: '较高' },
            { value: 58, name: '一般' },
            { value: 30, name: '较低' },
            { value: 4, name: '很低' },
          ],
        },
      ],
    });
  };
  useEffect(() => {
    init();
  }, []);
  return (
    <div className="customer" style={{ backgroundColor: 'white' }}>
      <div className="customertitle">
        <span>价值评估统计</span>
        <img
          src=""
          alt=""
          onClick={() => history.push('/home/jzpg')}
        />
      </div>
      <div id="main" style={{ width: '400px', height: '400px' }}></div>
    </div>
  );
}
